package com.fyi.service.impl;

import com.fyi.entity.User;
import com.fyi.mapper.UserMapper;
import com.fyi.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    public User login(Integer loginId, String password) {
        return userMapper.login(loginId,password);
    }

    public List<User> selectAllUser() {
        return userMapper.selectAllUser();
    }

    public Integer addUser(User user) {
        return userMapper.addUser(user);
    }

    public Integer updateUser(User user) {
        return userMapper.updateUser(user);
    }

    public Integer deleteUser(Integer id) {
        return userMapper.deleteUser(id);
    }

    public User selectById(Integer id) {
        return userMapper.selectById(id);
    }

    public User selectByName(String name) {
        return userMapper.selectByName(name);
    }
}
